<%= render :partial => "nav_bar" %>
<%= render :partial => "layouts/top_stories" %>
<div class="left_articles">

<!-- start content -->

<h2>Create a New Story</h2>

<% form_for(@story) do |f| %>
  <%= f.error_messages %>

  <p>
    <h4><%= f.label :title %></h4>
    <%= f.text_field :title %>
    <h4><%= f.label :rating %></h4>
    <%= select( "story", "story_rating", ["G", "PG", "PG-13", "R", "NC-17"]) %>
		<h4><%= f.label :type %></h4>
		<%= select( "story", "typ", ["Prose", "Limerick", "Haiku"]) %>
    <BR><div id="story_descrips">
    <%= link_to_remote("show type descriptions", :update=>"story_descrips", :url=>{:action=> :show_descrips }, :complete=>visual_effect("slide_down", "story_descrips") ) %>
    </div>
    <h4>Max Line Length (characters)</h4>
    <%= select( "story", "max_line_length", ["100", "10", "25", "500"]) %>
    <h4><%= f.label :summary %></h4>
    <%= f.text_area :summary %>
  </p>
  
<h4>Tags</h4>
  <% if @tags.nil? || @tags.length == 0 %>
  <p>There are no tags</p>
  <% else %>
    <select multiple name="tag_ids[]" size=5>
     <% for t in @tags do %>
        <option id="<%= t.id %>" value="<%= t.id %>"<% if @story.tags.include? t %> selected="selected"<%end%>> <%= t.name %>
     <% end %>
     </select>
  <% end %>
  
  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', stories_path %>

<!-- end content -->
</div>
</div>
<%= render :partial => "layouts/right_bar" %>